#ifndef OBJECT_H_INCLUDED
#define OBJECT_H_INCLUDED

#include "SDL/SDL.h"

#include "Image.h"
#include "helpers.h"
#include "Tile.h"
#include "Artist.h"

struct ObjectInfo
{
    std::string type;
    int x;
    int y;
    Direction orientation;
};

class Object
{
    public:
        Object(bool anc = true);
        Object(int x, int y, std::string newType, Direction orientation);
        ~Object();

        virtual SDL_Rect* get_bounds();
        virtual void set_image(Artist& artist, std::string filepath = "");
        virtual void rotate(Artist& artist, Direction dir, bool rotate_flipped);
        virtual void display(SDL_Rect camera, SDL_Surface* screen, bool lock_position = false);
        virtual SDL_Rect get_bounds_copy();

        //for saving map data
        ObjectInfo get_info();

    protected:
        bool anchored;
        bool halfspeedscroll;

        Direction orient;

        std::string type;

        int xVelocity, yVelocity, damage;

        SDL_Rect bounds;

        Image img;

        virtual void initFromFile();
};

#endif // OBJECT_H_INCLUDED
